﻿using SMS.dao;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Data.SqlTypes;

namespace SMS.cntr
{
    public class GradeCntr
    {
        private static readonly GradeCntr INSTANCE = new GradeCntr();

        public static GradeCntr Instance
        {
            get
            {
                return INSTANCE;
            }
        }

        private GradeCntr() { }

        public DataTable findClazz(string blockID)
        {
            return GradeDao.Instance.findClazz(blockID);
        }

        public DataTable listBlock()
        {
            return GradeDao.Instance.listBlock();
        }

        public DataTable listCourse()
        {
            return GradeDao.Instance.listCourse();
        }

        public DataTable listSemester()
        {
            return GradeDao.Instance.listSemester();
        }

        public DataTable listGradeAll(int claID, int corID, int semID)
        {
            return GradeDao.Instance.listGradeAll(claID, corID, semID);
        }

        public DataTable listGradeByClass(int claID)
        {
            return GradeDao.Instance.listGradebyClass(claID);
        }

        public DataTable listGradeByCourse(int claID, int corID)
        {
            return GradeDao.Instance.listGradebyCourse(claID, corID);
        }

        public DataTable listGradeRate(int corID, int semID)
        {
            return GradeDao.Instance.listGradeRate(corID, semID);
        }

        public DataTable listGradeRateByCourse(int corID)
        {
            return GradeDao.Instance.listGradeRateByCourse(corID);
        }

		public DataTable listClassRateBySemester(int semID)
        {
            return GradeDao.Instance.listClassRateBySemester(semID);
        }

        public int insert(int studentId, int classId, int courseId, int semesterId, SqlDouble fifteenMinTest, SqlDouble sixtyMinTest, SqlDouble finalTest)
        {
            return GradeDao.Instance.insert(studentId, classId, courseId, semesterId, fifteenMinTest, sixtyMinTest, finalTest);
        }

        public int edit(int gradeId, SqlDouble fifteenMinTest, SqlDouble sixtyMinTest, SqlDouble finalTest)
        {
            return GradeDao.Instance.edit(gradeId, fifteenMinTest, sixtyMinTest, finalTest);
        }
    }
}
